
local function fun(...)
    local args = {...}
    for i, v in ipairs(args) do
        print(i, v)
    end
    
end



fun(1, 2, 3, 4, 5)

local function fun2(a1, a2, ...)
    print("fun2: ", a1, a2, ...)
    local args = {...}
    for i, v in ipairs(args) do
        print(i, v)
    end
    print('\n');
end

fun2(1, 2, 3, 4, 5)

print('\n');
print('pairs: ')
t = { a=1, b=2, c=3, 4, 5}
for k, v in pairs(t) do
    print(k, v)
end
print('\n');
print('ipairs: ')
for k, v in ipairs(t) do
    print(k, v)
end
print('\n');


local funA 

local function funB()
    funA()
    print('funcB')
end

funA = function()
    print('funA')
end

print('funB -> funA')
funB();

local A; function B() A() end; A = function() end